package psnl.bingo.bgtool.model.dto;

public class RenameSet {
    public String dirPath;
    public Integer typeMain;
    public String typeOrder;
    public Integer start;
    public Integer end;
    public String prefix;
    public String suffix;
    public String onlySuffix;
    public String skipPrefix;
    public String skipSuffix;
    public Boolean ifTest;

    @Override
    public String toString() {
        return "RenameSet{" +
                "dirPath='" + dirPath + '\'' +
                ", typeMain=" + typeMain +
                ", typeOrder=" + typeOrder +
                ", start=" + start +
                ", end=" + end +
                ", prefix='" + prefix + '\'' +
                ", suffix='" + suffix + '\'' +
                ", onlySuffix='" + onlySuffix + '\'' +
                ", ifTest='" + ifTest + '\'' +
                '}';
    }

    public boolean ifSkip(String name) {
        if(onlySuffix!=null && !name.endsWith(onlySuffix)) {
            return true;
        }

        if(skipPrefix!=null && name.startsWith(skipPrefix)) {
            return true;
        }

        if(skipSuffix!=null && name.endsWith(skipSuffix)) {
            return true;
        }

        return false;
    }
}
